﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DeadlockDetection
{
    public class Resource
    {
        public int numberOfInstances;
        public int availableInstances;
        public int resourceType;

        public override string ToString()
        {
            return ("R" + resourceType);
        }

        public Resource(int number, int nOfInstances)
        {
            resourceType = number;
            numberOfInstances = nOfInstances;
            availableInstances = numberOfInstances;
        }

        public Resource(int number, int nOfInstances, int available)
        {
            resourceType = number;
            numberOfInstances = nOfInstances;
            availableInstances = available;
        }

        public Resource(int number)
        {
            resourceType = number;
            numberOfInstances = 1;
            availableInstances = numberOfInstances;
        }
    }
}
